<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Block</title>
</head>
<body>
<?php
include("../connection/connection.php");
include("reportFunctions.php");
$distId=$_REQUEST['distId'];
$supplyDuration1=0;
$supplyDuration2=0;
$supplyDuration3=0;
$supplyDuration4=0;
$supplyDuration5=0;
$supplyDuration6=0;
$supplyDuration7=0;
$supplyDuration1=getSupplyDuration($distId,"zero","");
$supplyDuration2=getSupplyDuration($distId,0,1);
$supplyDuration3=getSupplyDuration($distId,1,2);
$supplyDuration4=getSupplyDuration($distId,2,4);
$supplyDuration5=getSupplyDuration($distId,4,6);
$supplyDuration6=getSupplyDuration($distId,6,"");
$supplyDuration7=getSupplyDuration($distId,"","null");
$supplyDurationTot=$supplyDuration7+$supplyDuration6+$supplyDuration5+$supplyDuration4+$supplyDuration3+$supplyDuration2+$supplyDuration1;
//echo number_format(($supplyDuration2/$supplyDurationTot)*100,2);
?>
<table border="0" width="444" cellspacing="0" cellpadding="0">
	<tr>
		<td width="800" height="26" bgcolor="#E9E9E9">
		<p align="center"><span style="font-size: 9pt; font-weight: 700">
	  <font face="Verdana" color="#224568">Distribution Frequency of Water Supply</font></span></td>
	</tr>
	<tr>
	  <td height="26" bgcolor="#E9E9E9"><div align="center"><font face="Verdana" style="font-size: 9pt; font-weight: 700" color="#224568">Table 12 </font></div></td>
  </tr>
	<tr>
		<td bgcolor="#E9E9E9" height="56">
		<table border="1" width="443" cellspacing="0" cellpadding="0" height="55" bgcolor="#C5D8EB">
			<tr>
				<td width="40" height="53" align="center">
				<p align="center"><font face="Verdana" style="font-size: 8.5pt">
				S. No.</font></td>
				<td width="130" align="center">
				<font face="Verdana" style="font-size: 8.5pt">Water Supply (hrs/day) </font></td>
				<td width="140" align="center">
				  <p align="center">
			  <font style="font-size: 8.5pt" face="Verdana">No. of Schemes</font></td>
				<td width="123" align="center">
				  <font style="font-size: 8.5pt" face="Verdana">Percentage of Schemes</font></td>
			</tr>
		</table>		</td>
	</tr>
	<tr>
		<td>
		<table border="1" width="444" cellspacing="0" cellpadding="0" height="49" bordercolor="#C5D8EB" style="border: 1px solid #BBD1E8" bgcolor="#F9F9F9">
			<tr>
				<td width="42" align="center"><font face="Verdana" style="font-size: 8.5pt">1</font></td>
				<td width="129" align="center"><font face="Verdana" style="font-size: 8.5pt">0</font></td>
				<td width="139" align="center"><font face="Verdana" style="font-size: 8.5pt"><?php echo $supplyDuration1;?></font></td>
				<td width="124" align="center"><font face="Verdana" style="font-size: 8.5pt"><?php 
				if($supplyDurationTot==0)
				{
				echo "0.00";
				}else{
				echo number_format(($supplyDuration1/$supplyDurationTot)*100,2,'.','');}?></font></td>
			</tr>
			<tr>
				<td width="42" align="center"><font face="Verdana" style="font-size: 8.5pt">2</font></td>
				<td width="129" align="center"><font face="Verdana" style="font-size: 8.5pt">0 to 1</font> </td>
				<td width="139" align="center"><font face="Verdana" style="font-size: 8.5pt"><?php echo $supplyDuration2;?></font></td>
				<td width="124" align="center"><font face="Verdana" style="font-size: 8.5pt">
				  <?php
				  if($supplyDurationTot==0)
				{
				echo "0.00";
				}else{
				   echo number_format($supplyDuration2/$supplyDurationTot*100,2,'.','');}?>
				</font></td>
			</tr>
			<tr>
				<td width="42" align="center"><font face="Verdana" style="font-size: 8.5pt">3</font></td>
				<td width="129" align="center"><font face="Verdana" style="font-size: 8.5pt">1 to 2 </font></td>
				<td width="139" align="center"><font face="Verdana" style="font-size: 8.5pt"><?php echo $supplyDuration3;?></font></td>
				<td width="124" align="center"><font face="Verdana" style="font-size: 8.5pt"><?php 
				 if($supplyDurationTot==0)
				{
				echo "0.00";
				}else{
				echo number_format(($supplyDuration3/$supplyDurationTot)*100,2,'.','');}?></font></td>
			</tr>
			<tr>
				<td width="42" align="center"><font face="Verdana" style="font-size: 8.5pt">4</font></td>
				<td width="129" align="center"><font face="Verdana" style="font-size: 8.5pt">2 to 4 </font></td>
				<td width="139" align="center"><font face="Verdana" style="font-size: 8.5pt"><?php echo $supplyDuration4;?></font></td>
				<td width="124" align="center"><font face="Verdana" style="font-size: 8.5pt"><?php 
				 if($supplyDurationTot==0)
				{
				echo "0.00";
				}else{
				echo number_format(($supplyDuration4/$supplyDurationTot)*100,2,'.','');}?></font></td>
			</tr>
			<tr>
				<td width="42" align="center"><font face="Verdana" style="font-size: 8.5pt">5</font></td>
				<td width="129" align="center"><font face="Verdana" style="font-size: 8.5pt">4 to 6</font> </td>
				<td width="139" align="center"><font face="Verdana" style="font-size: 8.5pt"><?php echo $supplyDuration5;?></font></td>
				<td width="124" align="center"><font face="Verdana" style="font-size: 8.5pt"><?php 
				 if($supplyDurationTot==0)
				{
				echo "0.00";
				}else{
				echo number_format(($supplyDuration5/$supplyDurationTot)*100,2,'.','');}?></font></td>
			</tr>
			<tr>
				<td width="42" align="center"><font face="Verdana" style="font-size: 8.5pt">6</font></td>
				<td width="129" align="center"><font face="Verdana" style="font-size: 8.5pt">&gt;6</font></td>
				<td width="139" align="center"><font face="Verdana" style="font-size: 8.5pt"><?php echo $supplyDuration6;?></font></td>
				<td width="124" align="center"><font face="Verdana" style="font-size: 8.5pt"><?php 
				 if($supplyDurationTot==0)
				{
				echo "0.00";
				}else{
				echo number_format(($supplyDuration6/$supplyDurationTot)*100,2,'.','');}?></font></td>
			</tr>
			<tr>
				<td width="42" align="center"><font face="Verdana" style="font-size: 8.5pt">7</font></td>
				<td width="129" align="center"><font face="Verdana" style="font-size: 8.5pt">Not Provided (NP)</font></td>
				<td width="139" align="center"><font face="Verdana" style="font-size: 8.5pt"><?php echo $supplyDuration7;?></font></td>
				<td width="124" align="center"><font face="Verdana" style="font-size: 8.5pt"><?php 
				 if($supplyDurationTot==0)
				{
				echo "0.00";
				}else{
				echo number_format(($supplyDuration7/$supplyDurationTot)*100,2,'.','');}?></font></td>
			</tr>
			<tr>
				<td colspan="2" align="center" bgcolor="#E9E9E9">
				<font style="font-size: 8.5pt" face="Verdana"><font style="font-size: 8.5pt" face="Verdana">Total</font></td>
				<td width="139" align="center" bgcolor="#E9E9E9"><font face="Verdana" style="font-size: 8.5pt"><?php echo $supplyDurationTot;//=getSupplyDuration($distId,"","");?></font></td>
				<td width="124" align="center" bgcolor="#E9E9E9"><font face="Verdana" style="font-size: 8.5pt">&nbsp;</font></td>
			</tr>
		</table>		</td>
	</tr>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>


</body>

</html>